<template>
  <div>
    <Heads title="地址管理" :right-flag="judgeRightFlag" :right-click="toAddressManage"></Heads>
    <div>
      <router-view></router-view>
    </div>
  </div>
</template>

<script>
import { mapMutations } from 'vuex'

export default {
  data() {
    return {
    }
  },
  computed: {
    judgeRightFlag() {
      if (this.$route.name === 'Address-manage') {
        return false
      } else {
        return true
      }
    }
  },
  methods: {
    ...mapMutations('footerModule', ['FOOTERSHOW']),
    toAddressManage() {
      switch (this.$route.name) {
        case "Address-list":
          // 压栈
          this.$router.push({
            name: 'Address-manage'
          })
          break;
        default:
          // 不压栈
          this.$router.replace({
            name: 'Address-manage'
          })
          break;
      }

    }
  },
  mounted() {
    this.FOOTERSHOW(false)
  },
  destroyed() {
    this.FOOTERSHOW(true)
  }
}
</script>

<style>
</style>
